var express = require('express');
var app = express();
var fs = require('fs');
var cors = require('cors')

app.use(cors({
    credentials: true,
    origin: '*',
}))

app.get('/getData', function (req, res) {
   fs.readFile( __dirname + '/data.json', 'utf8', function (err, data) {
       data = JSON.parse( data );

       res.status(200).send(JSON.stringify(data));
   });
})

var server = app.listen(8081, function () {

  var host = server.address().address
  var port = server.address().port


})